package main

import "fmt"

func bubblingSorting[T int | float64](list []T) []T {
	n := len(list)
	for i := 0; i < n-1; i++ {
		for j := 0; j < n-i-1; j++ {
			if list[j] > list[j+1] {
				list[j], list[j+1] = list[j+1], list[j]
			}
		}
	}
	return list
}

func main() {
	l := []int{3, 1, 2, 13, 6, 7, 0}
	fmt.Println(bubblingSorting(l))

	l2 := []float64{3.1, 1.5, 1.2, 13, 6.1, 5.7, 7.3}
	fmt.Println(bubblingSorting(l2))
}
